package com.framework.web.bus.repository;

import com.framework.web.bus.domain.Order;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
* @Title: Repository
* @Description: repository
* @author zqtao
* @date 2016-09-11
* @version V1.0
*
*/
public interface OrderRepository extends JpaRepository<Order, String>,
JpaSpecificationExecutor<Order> {

    /**
     * 根据订单状态获取订单信息
     * @param orderStatus
     * @return
     */
    public List<Order> findByOrderStatusAndUserId(Integer orderStatus,String userId);

    /**
     * 根据订单id和订单状态查询订单
     * @param orderId
     * @param status
     * @return
     */
    public Order findByIdAndOrderStatus(String orderId,Integer status);
}